
#include <config.h>
#include <genericdeletedialog.h>

GenericDeleteDialog::GenericDeleteDialog(QWidget *parent)
  : QDialog(parent)
{
  _gui.setupUi(this);
  setWindowTitle(CE_TOOL_NAME);
}

void GenericDeleteDialog::SetDeleteType(const QString& type)
{
  _gui.labelDelete->setText ("Delete " + type);
}

void GenericDeleteDialog::SetDeleteMessage(const QString &msg)
{
  _gui.labelMessage->setText (msg);
}

void GenericDeleteDialog::on_pushButtonNo_clicked()
{
  reject();
}

void GenericDeleteDialog::on_pushButtonYes_clicked()
{
  accept();
}


bool GenericDeleteDialog::Delete(QWidget *parent, const QString &type, const QString &msg)
{
  GenericDeleteDialog dlg(parent);
  dlg.SetDeleteType(type);
  dlg.SetDeleteMessage(msg);
  return dlg.exec() == QDialog::Accepted;
}
